package com.ct.gd.passport.view.passport;

import org.apache.commons.lang3.StringUtils;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.ct.gd.passport.R;
import com.ct.gd.passport.common.BaseActivity;
import com.ct.gd.passport.view.widget.CustomHeaderFragment;

public class PassportAppFinishActivity extends BaseActivity implements OnClickListener {

	private CustomHeaderFragment	mFgHeader;
    
	TextView mTvFinishInfo;
    Button mFinishBtn;
    
    @Override
	protected void onBaseCreate(Bundle savedInstanceState) {
		setContentView(R.layout.passport_app_finsh);
	}

	@Override
	protected void initViews() {
		
		mFgHeader = (CustomHeaderFragment) getSupportFragmentManager().findFragmentById(R.id.header);
		mFgHeader.setLeftView(null);
		mFgHeader.setCenterText(getString(R.string.passport_application));

		mFinishBtn = (Button)findViewById(R.id.btn_app_finish);
		mFinishBtn.setOnClickListener(this);
		
		mTvFinishInfo = (TextView)findViewById(R.id.tv_app_finish);
	}

	@Override
	protected void onAfterCreate(Bundle savedInstanceStat) {
		if(null != getIntent().getExtras()){
			String result = getIntent().getExtras().getString("result");
			if(StringUtils.isNotBlank(result)){
				mTvFinishInfo.setText(result);
			}
		}
	}
	
	@Override
	public void onClick(View v) {
		if(v.getId() == mFinishBtn.getId()){
			finish();
		}
	}

}
